Conversion between different files always enjoys great popularity among people. It is also a hot and permanent topic talked about. Especially for PDF document conversion, as a most popular file format, PDF has so many advantages. So “Convert to PDF” is most concerned by people. I have talked about how to convert HTML, XML, Image, Text, Word, Excel to PDF. Now it is time to show how to save RTF file as PDF document with C#, VB.NET.
The method is the easiest way to save RTF file as PDF if you use Spire.Doc, which is an MS Word creation component and supports .NET and Silverlight. Please look at the whole procedure.
The method is the easiest way to save RTF file as PDF if you use Spire.Doc, which is an MS Word creation component and supports .NET and Silverlight. Please look at the whole procedure.
Step1. Create a new project.
1. Create a new project in Visual Studio.
2. Set the project Properties .Target Framework to be .NET Framework 2 or above.
3. Add Spire.Doc dll and System.Drawing as reference in Project.
Step2. Save RTF file as PDF document.
1. Create a new document.
2. Load a RTF file from system.
3. Save the RTF file as PDF document
C# Code:
Document doc = new Document();
doc.LoadFromFile(@"D:\michelle\JaneEyre.rtf", FileFormat.Rtf);
doc.SaveToFile("test.pdf", FileFormat.PDF);
System.Diagnostics.Process.Start("test.pdf");
VB.NET Code:
Dim doc As New Document()
doc.LoadFromFile("D:\michelle\JaneEyre.rtf", FileFormat.Rtf)
doc.SaveToFile("test.pdf", FileFormat.PDF)
System.Diagnostics.Process.Start("test.pdf")
Preview
Isn’t it the easiest way to convert RTF to PDF? Why not take this method to try? You can
Freely Install Spire.Doc